import React, { Component } from 'react';
import "../../../styles/Index/Mine/OrderState.scss"
import { PayCircleOutline, TruckOutline, LikeOutline, FileOutline } from 'antd-mobile-icons';
import { withRouter } from 'react-router-dom';
class OrderState extends Component {
    constructor(props) {
        super(props);
        this.state = {
            orderstate: [
                {
                    icon: <PayCircleOutline />,
                    name: '待付款',
                    key: 'obligation'
                },
                {
                    icon: <TruckOutline />,
                    name: '待收货',
                    key: 'takegood'
                },
                {
                    icon: <LikeOutline />,
                    name: '待评价',
                    key: 'evaluate'
                },
                {
                    icon: <FileOutline />,
                    name: '全部订单',
                    key: 'allorder'
                },
            ]
        }
    }
    dianji(key) {
        console.log(key);
        this.props.history.push('/orderstate')
    }
    render() {
        return (
            <div className='orderstate'>

                    {
                        this.state.orderstate.map((item, index) => {
                            return (
                                <div className="item" key={index} onClick={() => { this.dianji(item.key) }}>
                                        <div className="icon">{item.icon}</div>
                                        <div className="name">{item.name}</div>
                                </div>
                            )
                        })
                    }
            </div>
        );
    }
}

export default withRouter(OrderState);